<!-- sunsblog.net CMS pocetok.inc (c)2004 Gjokica Zafirovski -->
<table style="font-size:10;">
<?
if ($a == 'delete') {
$sqld = "select * from $tbl_sodrzina where id='$s_id'";
$resd = mysql_query ($sqld)
	or die("Try again sunser!");
$rowd = mysql_fetch_array ($resd);
?>
<tr>
<td colspan="5">
<form name="novasodrzina" action="izbrisisodrzina.php" method="POST">
<input type="hidden" name="s_id" value="<? print $s_id ?>">
<input type="hidden" name="l_id" value="<? print $l_id ?>">
Дали навистина сакаш да ја избpишеш оваа содpжина?:<br/>
<? echo "Наслов: ".$rowd['naslov'] ?>
<br/>
<input name="submit" type="submit" value="Да"><br />
</form>
</td>
</tr>
<? 
exit;
}
if ($a == 'edit') {
$sqle = "select * from $tbl_sodrzina where id='$s_id'";
$rese = mysql_query ($sqle)
	or die("Try again sunser!");
$rowe = mysql_fetch_array ($rese);
?>
<tr>
<td colspan="5">
<form name="novasodrzina"  action="izmenisodrzina.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="s_id" value='<? print $s_id ?>'>
<input type="hidden" name="l_id" value="<? print $l_id ?>">
Нова содржина:<br />
Наслов:<br /><input name="naslov" type="text" size="20" value="<? print $rowe['naslov'] ?>"><br />
Поднаслов:<br /><textarea name="podnaslov" cols="50" rows="5"><? print $rowe['podnaslov'] ?></textarea><br />
Четиво:<br /><textarea name="cetivo" cols="50" rows="20"><? print $rowe['cetivo'] ?></textarea><br />
Слика:<br /><input name="slika" type="file" size="20" value="<? print $rowe['slika'] ?>"><br />
Опис на слика:<br /><textarea name="opisslika" cols="50" rows="5">
<? print $rowe['opisslika'] ?>
</textarea><br />
Статус:<input type="radio" name="status" value="1"/>on&nbsp;<input type="radio" name="status" value="0" />off<br />
<input name="submit" type="submit" value="submit"><br />
</form>
</td>
</tr>
<?
exit;
}
$sql = "select * from $tbl_sodrzina where lokacija='$l_id'";
$res = mysql_query ($sql)
	or die("Try again sunser!");
while ($row = mysql_fetch_array ($res)) {
echo "<tr style='background-color:#F0F0F0'>";
echo "<td valign='top'>";
echo $row['id'];
echo "</td>";
echo "<td valign='top'>";
echo $row['naslov'];
echo "</td>";
echo "<td valign='top'>";
echo $row['podnaslov'];
echo "</td>";
echo "<td valign='top'>";
echo "<textarea cols='50' rows='5'>".$row['cetivo']."</textarea>";
echo "</td>";
echo "<td valign='top'>";
echo "<a href='../images/".$row['slika']."' target='_blank'>slika</a>";
echo "</td>";
echo "<td valign='top'>";
echo $row['opisslika'];
echo "</td>";
echo "<td valign='top'>";
echo $row['status'];
echo "</td>";
echo "<td valign='top'>";
echo "<a href='?s=true&a=edit&s_id=".$row['id']."&l_id=".$l_id."'>Измени</a>";
echo "</td>";
echo "<td valign='top'>";
echo "<a href='?s=true&a=delete&s_id=".$row['id']."&l_id=".$l_id."'>Избриши</a>";
echo "</td>";
echo "</tr>" ;
}
?>
<tr>
<td colspan="5">
<form name="novasodrzina"  action="novasodrzina.php" method="POST" enctype="multipart/form-data">
<? echo '<input type="hidden" name="lokacija" value="'.$l_id.'">' ?>
Нова содржина:<br />
Наслов:<br /><input name="naslov" type="text" size="20" ><br />
Поднаслов:<br /><textarea name="podnaslov" cols="50" rows="5" >
</textarea><br />
Четиво:<br /><textarea name="cetivo" cols="50" rows="20" ></textarea><br />
Слика:<br /><input name="slika" type="file" size="20" ><br />
Опис на слика:<br /><textarea name="opisslika" cols="50" rows="5" ></textarea><br />
Статус:<input checked type="radio" name="status" value="1"/>on&nbsp;<input type="radio" name="status" value="0" />off<br />
<input name="submit" type="submit" value="submit"><br />
</form>
</td>
</tr>
</table>